package com.ruoyi.system.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SpotsOrderMapper;
import com.ruoyi.system.domain.SpotsOrder;
import com.ruoyi.system.service.ISpotsOrderService;

/**
 * 景点订单Service业务层处理
 *
 * @author Y.C
 * @date 2024-02-21
 */
@Service
public class SpotsOrderServiceImpl  extends ServiceImpl<SpotsOrderMapper,SpotsOrder> implements ISpotsOrderService
{
    @Autowired
    private SpotsOrderMapper spotsOrderMapper;

    /**
     * 查询景点订单
     *
     * @param orderId 景点订单主键
     * @return 景点订单
     */
    @Override
    public SpotsOrder selectSpotsOrderByOrderId(Long orderId)
    {
        return spotsOrderMapper.selectSpotsOrderByOrderId(orderId);
    }

    /**
     * 查询景点订单列表
     *
     * @param spotsOrder 景点订单
     * @return 景点订单
     */
    @Override
    public List<SpotsOrder> selectSpotsOrderList(SpotsOrder spotsOrder)
    {
        return spotsOrderMapper.selectSpotsOrderList(spotsOrder);
    }

    /**
     * 新增景点订单
     *
     * @param spotsOrder 景点订单
     * @return 结果
     */
    @Override
    public int insertSpotsOrder(SpotsOrder spotsOrder)
    {
        spotsOrder.setCreateTime(DateUtils.getNowDate());
        return spotsOrderMapper.insertSpotsOrder(spotsOrder);
    }

    /**
     * 修改景点订单
     *
     * @param spotsOrder 景点订单
     * @return 结果
     */
    @Override
    public int updateSpotsOrder(SpotsOrder spotsOrder)
    {
        spotsOrder.setUpdateTime(DateUtils.getNowDate());
        return spotsOrderMapper.updateSpotsOrder(spotsOrder);
    }

    /**
     * 批量删除景点订单
     *
     * @param orderIds 需要删除的景点订单主键
     * @return 结果
     */
    @Override
    public int deleteSpotsOrderByOrderIds(Long[] orderIds)
    {
        return spotsOrderMapper.deleteSpotsOrderByOrderIds(orderIds);
    }

    /**
     * 删除景点订单信息
     *
     * @param orderId 景点订单主键
     * @return 结果
     */
    @Override
    public int deleteSpotsOrderByOrderId(Long orderId)
    {
        return spotsOrderMapper.deleteSpotsOrderByOrderId(orderId);
    }


}
